package cas.ihep.fs.impl;

import cas.ihep.fs.UnifiedFileSystem;

public class CreateOptionsImpl implements UnifiedFileSystem.CreateOptions{

    public static class AppendOptionsImpl extends CreateOptionsImpl implements UnifiedFileSystem.AppendOptions{}
    private long _blockSize;
    private int _bufferSize;
    private short _replication,_permission;
    private boolean _overwrite,_createParent;

    public CreateOptionsImpl(){
        _blockSize=2147483648L;
        _replication=1;
        //noinspection OctalInteger
        _permission= 0644;
        _overwrite=true;
        _createParent=true;
        _bufferSize=65536;
    }

    @Override
    public boolean overwrite() {
        return _overwrite;
    }

    @Override
    public boolean createParent() {
        return _createParent;
    }

    @Override
    public short replication() {
        return _replication;
    }

    @Override
    public short permission() {
        return _permission;
    }

    @Override
    public long blockSize() {
        return _blockSize;
    }

    @Override
    public int bufferSize() {
        return _bufferSize;
    }

    @Override
    public void setOverwrite(boolean overwrite) {
        _overwrite=overwrite;
    }

    @Override
    public void setCreateParent(boolean createParent) {
        _createParent=createParent;
    }

    @Override
    public void setReplication(short replication) {
        _replication=replication;
    }

    @Override
    public void setPermission(short permission) {
        _permission=permission;
    }

    @Override
    public void setBlockSize(long blockSize) {
        _blockSize=blockSize;
    }

    @Override
    public void setBufferSize(int bufSize) {
        _bufferSize=bufSize;
    }
}
